import { request } from '@ruifox-cms/utils'

//刷新token
export function insertPost(data) {
    return request({
        baseURL: process.env.NODE_ENV == 'development' ? '/recruitment_api' : '/api',
        url: '/recruitment/post/insert',
        method: 'post',
        data
    })
}

// 删除单个职位
export function deletePost(data) {
    return request({
        baseURL: process.env.NODE_ENV == 'development' ? '/recruitment_api' : '/api',
        url: '/recruitment/post/delete',
        method: 'post',
        data
    })
}

// 批量删除职位
export function deletePostList(data) {
    return request({
        baseURL: process.env.NODE_ENV == 'development' ? '/recruitment_api' : '/api',
        url: '/recruitment/post/deleteList',
        method: 'post',
        data
    })
}

// 分页查询表单
export function selectFormList(params) {
    return request({
        baseURL: process.env.NODE_ENV == 'development' ? '/recruitment_api' : '/api',
        url: '/recruitment/post/selectFormList',
        method: 'get',
        params
    })
}

// 查询职位列表（招聘方）
export function selectRecPage(params) {
    return request({
        baseURL: process.env.NODE_ENV == 'development' ? '/recruitment_api' : '/api',
        url: '/recruitment/post/selectRecPage',
        method: 'get',
        params
    })
}

// 查询职位列表（求职方）
export function selectSeekerPage(params) {
    return request({
        baseURL: process.env.NODE_ENV == 'development' ? '/recruitment_api' : '/api',
        url: '/recruitment/post/selectSeekerPage',
        method: 'get',
        params
    })
}

// 更新职位信息
export function updatePost(data) {
    return request({
        baseURL: process.env.NODE_ENV == 'development' ? '/recruitment_api' : '/api',
        url: '/recruitment/post/update',
        method: 'post',
        data
    })
}

// 根据id查职位详情
export function selectPostById(params) {
    return request({
        baseURL: process.env.NODE_ENV == 'development' ? '/recruitment_api' : '/api',
        url: '/recruitment/post/selectById',
        method: 'get',
        params
    })
}

// 更新职位状态
export function updateState(data) {
    return request({
        baseURL: process.env.NODE_ENV == 'development' ? '/recruitment_api' : '/api',
        url: '/recruitment/post/updateState',
        method: 'post',
        data
    })
}

// 批量更新职位状态
export function updateStatesList(data) {
    return request({
        baseURL: process.env.NODE_ENV == 'development' ? '/recruitment_api' : '/api',
        url: '/recruitment/post/updateStatesList',
        method: 'post',
        data
    })
}

// 审核职位
export function auditPost(data) {
    return request({
        baseURL: process.env.NODE_ENV == 'development' ? '/recruitment_api' : '/api',
        url: '/recruitment/post/updateStatesCheck',
        method: 'post',
        data
    })
}

// 批量审核职位
export function auditPostList(data) {
    return request({
        baseURL: process.env.NODE_ENV == 'development' ? '/recruitment_api' : '/api',
        url: '/recruitment/post/updateStatesListCheck',
        method: 'post',
        data
    })
}

// 查询表单地址
export function selectFormLink(params) {
    return request({
        baseURL: process.env.NODE_ENV == 'development' ? '/recruitment_api' : '/api',
        url: '/recruitment/post/selectFormLink',
        method: 'get',
        params
    })
}

//收藏职位
export function insertPostCollect(data) {
    return request({
        baseURL: process.env.NODE_ENV == 'development' ? '/recruitment_api' : '/api',
        url: '/recruitment/postCollect/insert',
        method: 'post',
        data
    })
}
//取消收藏职位
export function deletePostCollect(data) {
    return request({
        baseURL: process.env.NODE_ENV == 'development' ? '/recruitment_api' : '/api',
        url: '/recruitment/postCollect/delete',
        method: 'post',
        data
    })
}
//分页查询职位收藏
export function selectPostCollect(params) {
    return request({
        baseURL: process.env.NODE_ENV == 'development' ? '/recruitment_api' : '/api',
        url: '/recruitment/postCollect/selectPage',
        method: 'get',
        params
    })
}
//获取相关职位
export function selectRecommend(params) {
    return request({
        baseURL: process.env.NODE_ENV == 'development' ? '/recruitment_api' : '/api',
        url: '/recruitment/post/selectRecommend',
        method: 'get',
        params
    })
}